﻿@model IEnumerable<PessMvc.Models.UserModel>

@{
    ViewBag.Title = "UserManagement";
}

<h2>User Management</h2>
<div id="operate">
    @Html.ActionLink("Create Chair", "CreateChair", "Account")
    @Html.ActionLink("Create Editor", "CreateEditor", "Account")
    @Html.ActionLink("Back", "SystemSettings", "Home")

</div>
<div class="displayConScroe">
    <table>
        <tr>
            <th>
                @Html.DisplayNameFor(model => model.UserName)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Email)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.FirstName)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.LastName)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.PhoneNumber)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.SchoolName)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Roles)
            </th>
            <th ></th>
        </tr>

        @foreach (var item in Model)
        {
            <tr>
                <td>
                    @Html.DisplayFor(modelItem => item.UserName)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Email)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.FirstName)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.LastName)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.PhoneNumber)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.SchoolName)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Roles)
                </td>
                <td style ="width:200px; text-wrap:none">
                    @*@Html.ActionLink("Edit", "Edit", new { /* id=item.PrimaryKey */ }) |
            @Html.ActionLink("Details", "Details", new { /* id=item.PrimaryKey */ }) |*@
                    @Html.ActionLink("Delete", "DeleteUser", new { id = item.UserId })
                    @Html.ActionLink("Edit Roles", "EditUserRoles", new { id = item.UserId })
                    | Reset Password
                </td>
            </tr>
        }

    </table>
    </div>
